﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;

namespace IDE_week2_Forms_project
{
    public partial class Form1 : Form
    {
        bool languageDutch = false;
        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources = new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }

        public Form1()
        {
            InitializeComponent();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            this.Icon = null;
        }

        private void IconB_Click(object sender, EventArgs e)
        {
            this.Icon = Properties.Resources.Icon2;
        }

        private void CallClassB_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];

        }

        private void LanguageB_Click(object sender, EventArgs e)
        {
            if (languageDutch == false)
            {
                ChangeLanguage("nl");
                languageDutch = true;
            }
            else
            {
                ChangeLanguage("en");
                languageDutch = false;
                
            }
        }

        private void NewFormB_Click(object sender, EventArgs e)
        {
            Form2 formal=new Form2();
            formal.Visible = true;
        }
    }
}
